Skip to content

Conversation

pquentin
Copy link
Member

@pquentin pquentin commented Sep 11, 2025

When generating rest-api-spec from the Elasticsearch specification, I noticed many missing default values. This was automated using this Python script:

import json
import os

for path in os.listdir("api"):
    if path == "_common.json":
        continue
    api_name = path.removesuffix(".json")
    print(api_name)
    with open(f"api/{path}") as f:
        d = json.load(f)

    for name, data in d[api_name].get("params", {}).items():
        if name == "master_timeout":
            desc = data.pop("description")
            data["default"] = "30s"
            if desc:
                # make sure description comes after default
                data["description"] = desc

    with open(f"api/{path}", "w") as f:
        d = json.dump(d, f, indent=2)
        print("", file=f)  # end with an empty line

@pquentin pquentin added >non-issue :Core/Infra/REST API REST infrastructure and utilities auto-backport Automatically create backport pull requests when merged v9.2.0 v8.19.5 v9.1.5 v9.0.8 labels Sep 11, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Sep 11, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

Copy link
Contributor

@mosche mosche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@pquentin pquentin merged commit 3d8f78b into elastic:main Sep 17, 2025
34 checks passed
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.19 Commit could not be cherrypicked due to conflicts
9.1 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 134525

pquentin added a commit to pquentin/elasticsearch that referenced this pull request Sep 17, 2025
(cherry picked from commit 3d8f78b)

# Conflicts:
#	rest-api-spec/src/main/resources/rest-api-spec/api/cluster.state.json
#	rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_data_stream_mappings.json
#	rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_data_stream_mappings.json
@pquentin
Copy link
Member Author

💔 Some backports could not be created

Status Branch Result
9.1
8.19 Conflict resolution was aborted by the user

Manual backport

To create the backport manually run:

backport --pr 134525

Questions ?

Please refer to the Backport tool documentation

pquentin added a commit to pquentin/elasticsearch that referenced this pull request Sep 17, 2025
mridula-s109 pushed a commit to mridula-s109/elasticsearch that referenced this pull request Sep 17, 2025
gmjehovich pushed a commit to gmjehovich/elasticsearch that referenced this pull request Sep 18, 2025
pquentin added a commit that referenced this pull request Oct 7, 2025
…134876)

* rest-api-spec: specify master_timeout default value (#134525)

(cherry picked from commit 3d8f78b)

# Conflicts:
#	rest-api-spec/src/main/resources/rest-api-spec/api/cluster.state.json
#	rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_data_stream_mappings.json
#	rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_data_stream_mappings.json

* Restore cluster_state description
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged backport pending :Core/Infra/REST API REST infrastructure and utilities >non-issue Team:Core/Infra Meta label for core/infra team v8.19.5 v9.1.5 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants